import React from "react";
import { Routes, Route } from "react-router";

// eslint-disable-next-line @typescript-eslint/no-explicit-any
function renderRoutes(routes: any[]) {
  return routes ? (
    <Routes>
      {routes.map((route, i) => {
        return <Route key={i} path={route.path} element={<route.element />} />;
      })}
    </Routes>
  ) : null;
}

export default renderRoutes;
